Micron Document
πŸŽ–οΈGitΠ―Ρ€Π°πŸŽ–οΈ

Node / meshtastic / Meshtastic-Android / files / docs / en / developer / persistence.md

Displaying Rendered β€’ View raw β€’ Download

docs/en/developer/persistence.md 0a44b948ec0573dc62ec68c19e46e62d40fcd1a3 (0a44b948) Text, 2.82 KB

title: Persistence
parent: Developer Guide
nav_order: 6
last_updated: 2026-05-13
aliases:
β€’ room
β€’ database
β€’ datastore
β€’ prefs

Persistence

How the Meshtastic app stores data across different mechanisms.

Room KMP Database

Module: T383838core:database

The primary structured data store:
β€’ Node information and history
β€’ Message history
β€’ Waypoints
β€’ Telemetry data
β€’ Channel configurations

Key Points

β€’ Uses Room KMP for cross-platform compatibility
β€’ Migrations managed through Room's built-in migration system
β€’ DAO interfaces live in T383838core:database
β€’ Repository layer in T383838core:repository provides the public API

What's Stored in Room

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Entity β”‚ Description β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ T383838NodeEntity β”‚ All known mesh nodes and their metadata β”‚
β”‚ T383838MyNodeEntity β”‚ The local node's own info β”‚
β”‚ T383838Packet β”‚ Message history (channel and direct), waypoints, and telemetry d… β”‚
β”‚ T383838ContactSettings β”‚ Per-contact mute and read-state β”‚
β”‚ T383838ReactionEntity β”‚ Emoji reactions on messages β”‚
β”‚ T383838MeshLog β”‚ Raw mesh protocol logs β”‚
β”‚ T383838MetadataEntity β”‚ Device metadata (firmware version, hardware model) β”‚
β”‚ T383838QuickChatAction β”‚ User-configured quick-chat messages β”‚
β”‚ T383838DeviceHardwareEntity β”‚ Cached device hardware catalog β”‚
β”‚ T383838FirmwareReleaseEntity β”‚ Cached firmware release info β”‚
β”‚ T383838TracerouteNodePositionEntity β”‚ Traceroute hop position data β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”‚ πŸ’‘ Note: Waypoints, telemetry, and channel data are stored within the T383838Packet entity (using the
β”‚ T383838port_num field to distinguish packet types) rather than in separate tables.

DataStore Preferences

Module: T383838core:datastore

For lightweight key-value preferences:
β€’ Local radio configuration (LocalConfig proto)
β€’ Module configuration (ModuleConfig proto)
β€’ Channel set data
β€’ Local statistics
β€’ Recently connected device addresses

Core Prefs

Module: T383838core:prefs

Higher-level preferences abstraction:
β€’ User-facing settings
β€’ App behavior configuration
β€’ Feature toggles

What Docs Intentionally Skip

The T383838feature:docs module does not use Room or any persistent database:
β€’ Documentation content is packaged as build-time assets
β€’ The docs corpus is versioned with the app binary
β€’ No migration story is needed for docs content
β€’ Optional UX state (last viewed page) could use T383838core:prefs but is not part of the docs data model

This is an intentional design decision to keep documentation:
β€’ Fully offline without database overhead
β€’ Replaceable with each app update
β€’ Simple to validate and test

Best Practices

β€’ Use Room for structured, queryable data that changes at runtime
β€’ Use DataStore for simple preferences and state
β€’ Use bundled resources/assets for static content
β€’ Never store sensitive data (keys, passwords) in plain Room tables
β€’ Always provide migrations for schema changes


Served by rngit 1.5.0 - Generated in 0.04s